from torch.utils.data import Dataset
import torch.nn as nn
import torch
import torchvision.transforms.functional as tf
import numpy as np


class Net_Dataset(Dataset):
    def __init__(self, x_data, y_data):
        self.x_data = np.array(x_data, dtype=np.float32)
        self.y_data = np.array(y_data, dtype=np.longlong)
        print(self.x_data.shape)

    def __getitem__(self, index):
        x = torch.from_numpy(self.x_data[index])
        y = self.y_data[index]
        return x, y

    def __len__(self):
        return self.y_data.shape[0]
